import java.io.*;
import java.util.Scanner;
import java.util.stream.IntStream;

//字节流
public class demo4 {
    public static void main(String[] args) throws IOException {
        File file = new File("../test.txt");
        InputStream inputStream = new FileInputStream(file);
        OutputStream outputStream = new FileOutputStream(file,true);
//        outputStream.write(65);
//        outputStream.write("好好好".getBytes());
//        inputStream.read();
        //一次只能读一个
//        System.out.println(inputStream.read());
        //一次读一个数组
//        byte[] cbuf = new byte[1024];
//        int n = inputStream.read(cbuf);
//        for(int i = 0;i<n;i++){
//            System.out.printf("%x\n",cbuf[i]);
//        }
        //使用scanner读取文件中的数据
        Scanner scanner = new Scanner(inputStream);
        String str = scanner.next();
        System.out.println(str);

        outputStream.close();
        inputStream.close();
    }
}
